<?php
/**
 * @project     : Travel
 * @copyright   : 
 * @desc        : Thuc hien cac thao tac tren bang tour
 * @coder       : Truong cong quyen
 * @createdate  : 3/11/2011
*/
class Tour_model extends CI_Model
{
    var $tour_id=0;
    var $type_tour_id='';
    var $tour_name_vi='';
    var $tour_name_en='';
    var $tour_brief_vi='';
    var $tour_brief_en='';
    var $tour_image='';
    var $tour_description_vi='';
    var $tour_description_en='';
    var $tour_routes_vi='';
    var $tour_routes_en='';
    var $tour_duration='';
    var $tour_depart_from_vi='';
    var $tour_depart_from_en='';
    var $tour_return_to_vi='';
    var $tour_return_to_en='';
    var $tour_status=1;

    
    public function __construct() {
        parent::__construct();
    }
    
    function get_all($status=1)
    {
        if($status!=-1)
        {
            $this->db->where('tour_status', $status);
        }
        $query = $this->db->get('tour');
        return $query->result();
        
    }
    
     function get_by_id($id)
    {
        $this->db->where('tour_id', $id);
        $query = $this->db->get('tour');
        return $query->row();
    }
    
    function get_limit($limit = 10, $offset = 0, $status = 1)
    {
        $this->db->order_by('tour_id', 'desc');
        $this->db->where('tour_status', $status);      
        $query = $this->db->get('tour', $limit, $offset);        
        return $query->result();
    }
    

}